package base;

import java.util.Scanner;

public class CharCount {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
//        s字符转换成char数组
        char[] chars = s.toCharArray();
        int en = 0;
        int kg = 0;
        int num = 0;
        int or=0;
        for (int i = 0; i < chars.length; i++) {
            if ((chars[i] >= 'A' && chars[i]<= 'Z' )||(chars[i] >= 'a' && chars[i]<= 'z')){
                en++;
            }else if (chars[i] == 32){
                kg++;
            }else if (chars[i] >= '0' && chars[i]<= '9'){
                num++;
            }else {
                or++;
            }
        }
        System.out.printf("%d %d %d %d",en,kg,num,or);
    }
}
